{include file="admin/head" /}
<body>
<div style="padding: 20px;">
    <form>
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
                <input type="text" name="username" class="layui-input" value="{$teacher.username}">
            </div>
            <div class="layui-form-mid layui-word-aux">
                这将是你唯一用户名
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-inline">
                <input type="text" name="realname" class="layui-input" value="{$teacher.realname}">
            </div>

        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机</label>
            <div class="layui-input-inline">
                <input type="text" name="tel" class="layui-input" value="{$teacher.tel}">
            </div>

        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-inline">
                <input type="text" name="email" class="layui-input" value="{$teacher.email}">
            </div>

        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" type="submit" onclick="add()">立即提交</button>
            </div>
        </div>
    </form>
</div>
<script>
    function add() {
        event.preventDefault();
        $.ajax({
            url: "",
            type: 'post',
            datatype: 'json',
            data: $('form').serialize(),
            success: function (data) {
                if (data.statu == 200) {
                    layer.alert(data.msg, {icon: 6}, function () {
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前frame
                        parent.layer.close(index);
                    })
                } else {
                    layer.msg(data.msg);
                }
            }
        })
    }
</script>
</body>
</html>